home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig03_07.jar
/
Ch03
/
Fig03_07
/
Fig03_07.cpp
Wrap
C/C++ Source or Header
|
1997-10-11
|
331b
|
19 lines
// Fig. 3.7: fig03_07.cpp
// Shifted, scaled integers produced by 1 + rand() % 6
#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
int main()
{
for ( int i = 1; i <= 20; i++ ) {
cout << setw( 10 ) << ( 1 + rand() % 6 );
if ( i % 5 == 0 )
cout << endl;
}
return 0;
}